package com.machine.filling.net.serialPort.receive;

import com.machine.filling.util.HexUtils;

import java.text.DecimalFormat;

/**
 * Created by Administrator on 2018/3/5 0005.
 * 串口 油机状态 数据域
 */

public class Receive_MachineState {
    private String version_1;
    private String gunNumHead_1;


    /**
     * 油机状态
     */
    private String stateStr;
    /**
     * 加油金额
     */
    private String fuel_amountStr;
    /**
     * 加油量
     */
    private String fuel_quantityStr;
    /**
     * 单价
     */
    private String unit_priceStr;

    public String getVersion_1() {
        return version_1;
    }

    public void setVersion_1(String version_1) {
        this.version_1 = version_1;
    }

    public String getGunNumHead_1() {
        return gunNumHead_1;
    }

    public void setGunNumHead_1(String gunNumHead_1) {
        this.gunNumHead_1 = gunNumHead_1;
    }

    public String getStateStr() {
        return stateStr;
    }

    public void setStateStr(String stateStr) {
        this.stateStr = stateStr;
    }

    public String getFuel_amountStr() {
        return fuel_amountStr;
    }
    public String getRealAmount(){
        return  new DecimalFormat("0.00").format(HexUtils.hex2Int(fuel_amountStr) * 0.01) + "";
    }
    public void setFuel_amountStr(String fuel_amountStr) {
        this.fuel_amountStr = fuel_amountStr;
    }

    public String getFuel_quantityStr() {
        return fuel_quantityStr;
    }

    public String getRealQuantity(){
        return new DecimalFormat("0.00").format(HexUtils.hex2Int(fuel_quantityStr) * 0.01) + "";
    }

    public void setFuel_quantityStr(String fuel_quantityStr) {
        this.fuel_quantityStr = fuel_quantityStr;
    }

    public String getUnit_priceStr() {
        return unit_priceStr;
    }

    public void setUnit_priceStr(String unit_priceStr) {
        this.unit_priceStr = unit_priceStr;
    }
}
